<?php
/**
 * simple routing controler
 * DESCRIBE PURPOSE HERE
 *
 */
class X_Controller_Router_Master extends X_Controller_Router
{    
	/**
	 * handle input, and it returns HTML and is not an 
	 * ajax request wrapp it in a master page
	 *
	 * @param Array Filtered SAE (Simple Array Event) Array
	 * @return variant
	 */
    public function respond(X_Broker_Event_Interface $oEvent)
    {
        $xResponse = parent::respond($oEvent);
        
        // check to see if this request needs master html
        if (X_Broker::getResponseType() == X_Broker_Response::ENCODE_HTML && 
            $oEvent->getData('ajax') != 'true')
        {
            $xResponse = X_Array_Tokenizer::combine(X_Broker::getRegisteredValues()+array('body' => $xResponse), X_Broker::getRegistered('theme_dir').'tpl/master.tpl.html');
        }
        
        return $xResponse;
    }
        
        
}
